/**
 * 巡检模块接口列表
 */
import axios from "../../http/axios"; // 导入接口域名列表
import base from "../base";

const insp = {
  /*南通的*/
  //巡检计划分页查询
  inspPlan(params) {
    return axios.get(`${base.inspUrl1}/ntcs/inspPlan/findInspPlanPage`,{
      params: params
    });
  },
  //添加巡检计划
  addInspPlan(params) {
    return axios.post(`${base.inspUrl1}/ntcs/inspPlan/addInspPlan`, params);
  },
  //查询添加巡检页面各下拉框
  findAddDropBox() {
    return axios.get(`${base.inspUrl1}/ntcs/inspPlan/findAddDropBox`);
  },
  //巡检人员下拉框
  findAddPersonDropBox(params) {
    return axios.get(`${base.inspUrl1}/ntcs/inspPlan/findAddPersonDropBox`,{
      params: params
    });
  },
  //巡检分页查询页面各下拉框
  findPageDropBox() {
    return axios.get(`${base.inspUrl1}/ntcs/inspPlan/findPageDropBox`);
  },
  //根据id删除巡检计划
  deleteInspPlanById(params) {
    return axios.delete(`${base.inspUrl1}/ntcs/inspPlan/deleteInspPlanById/`,{
      params: params
    });
  },














  addTmpl(params) {
    return axios.post(`${base.inspUrl}/insp/tmpl/save`, params);
  },
  deleteTmpl(params) {
    return axios.get(`${base.inspUrl}/insp/tmpl/delete/${params}`);
  },
  updateTmpl(params) {
    return axios.post(`${base.inspUrl}/insp/tmpl/update`, params);
  },
  queryTmplPage(params) {
    return axios.post(`${base.inspUrl}/insp/tmpl/list`, params);
  },
  queryTmplById(params) {
    return axios.get(`${base.inspUrl}/insp/tmpl/query/${params}`);
  },

  addPlan(params) {
    return axios.post(`${base.inspUrl}/insp/plan/batchSave`, params);
  },
  deletePlan(params) {
    return axios.get(`${base.inspUrl}/insp/plan/delete/${params}`);
  },
  updatePlan(params) {
    return axios.post(`${base.inspUrl}/insp/plan/update`, params);
  },
  queryPlanPage(params) {
    return axios.post(`${base.inspUrl}/insp/plan/list`, params);
  },
  queryPlanById(params) {
    return axios.get(`${base.inspUrl}/insp/plan/query/${params}`);
  },

  addTask(params) {
    return axios.post(`${base.inspUrl}/insp/task/save`, params);
  },
  deleteTask(params) {
    return axios.get(`${base.inspUrl}/insp/task/delete/${params}`);
  },
  updateTask(params) {
    return axios.post(`${base.inspUrl}/insp/task/update`, params);
  },
  queryTaskPage(params) {
    return axios.post(`${base.inspUrl}/insp/task/list`, params);
  },
  queryTaskById(params) {
    return axios.get(`${base.inspUrl}/insp/task/query/${params}`);
  },
  editTaskStatus(id, flag) {
    return axios.get(`${base.inspUrl}/insp/task/update-flag/${id}/${flag}`);
  },

  addHistory(params) {
    return axios.post(`${base.inspUrl}/insp/history/save`, params);
  },
  deleteHistory(params) {
    return axios.get(`${base.inspUrl}/insp/history/delete/${params}`);
  },
  updateHistory(params) {
    return axios.post(`${base.inspUrl}/insp/history/update`, params);
  },
  queryHistoryPage(params) {
    return axios.post(`${base.inspUrl}/insp/history/list`, params);
  },
  queryHistoryById(params) {
    return axios.get(`${base.inspUrl}/insp/history/query/${params}`);
  },
  queryHistoryProblems(name, bridgeId) {
    return axios.get(
      `${base.inspUrl}/insp/history/problem/list?name=${name}&id=${bridgeId}`
    );
  },
  //定期检查分页列表
  queryAll(params) {
    return axios.post(`${base.inspUrl}/insp/regular/queryAll`, params);
  },
  //根据id删除定期检查
  deleteRegular(params) {
    return axios.delete(`${base.inspUrl}/insp/regular/delete/${params}`);
  },
  //根据id查询定期检查
  getRegular(params) {
    return axios.get(`${base.inspUrl}/insp/regular/query/${params}`);
  },
  //修改定期检查
  updateRagular(params) {
    return axios.put(`${base.inspUrl}/insp/regular/update`, params);
  },
  //添加定期检查
  saveRegular(params) {
    return axios.post(`${base.inspUrl}/insp/regular/save`, params);
  },
};

export default insp;
